package com.ctyun.xstore.vod;

import com.ctyun.xstore.vod.clip.VodClipClient;
import com.ctyun.xstore.vod.snapshot.SnapshotClient;
import com.ctyun.xstore.vod.template.TranscodeTemplateClient;
import com.ctyun.xstore.vod.template.WatermarkTemplateClient;
import com.ctyun.xstore.vod.transcode.TranscodeTaskClient;
import com.ctyun.xstore.vod.video.VideoClient;
import com.ctyun.xstore.vod.vodsetting.VodSettingClient;

public final class VODClientBuilder {

	private String host;

	private String accessKey;

	private String secretKey;

	private VODClientBuilder() {
		super();
	}

	public static VODClientBuilder standard() {
		return new VODClientBuilder();
	}

	public String getHost() {
		return host;
	}

	public VODClientBuilder setHost(String host) {
		this.host = host;
		return this;
	}

	public String getAccessKey() {
		return accessKey;
	}

	public VODClientBuilder setAccessKey(String accessKey) {
		this.accessKey = accessKey;
		return this;
	}

	public String getSecretKey() {
		return secretKey;
	}

	public VODClientBuilder setSecretKey(String secretKey) {
		this.secretKey = secretKey;
		return this;
	}

	public VodSettingClient buildSettingsClient() {
		if (host == null) {
			return new VodSettingClient(accessKey, secretKey);
		}
		return new VodSettingClient(host, accessKey, secretKey);
	}

	public VideoClient buildVideoClient() {
		if (host == null) {
			return new VideoClient(accessKey, secretKey);
		}
		return new VideoClient(host, accessKey, secretKey);
	}

	public TranscodeTemplateClient buildTranscodeTemplateClient() {
		if (host == null) {
			return new TranscodeTemplateClient(accessKey, secretKey);
		}
		return new TranscodeTemplateClient(host, accessKey, secretKey);
	}

	public WatermarkTemplateClient buildWatermarkTemplateClient() {
		if (host == null) {
			return new WatermarkTemplateClient(accessKey, secretKey);
		}
		return new WatermarkTemplateClient(host, accessKey, secretKey);
	}

	public TranscodeTaskClient buildTranscodeTaskClient() {
		if (host == null) {
			return new TranscodeTaskClient(accessKey, secretKey);
		}
		return new TranscodeTaskClient(host, accessKey, secretKey);
	}

	public SnapshotClient buildSnapshotClient() {
		if (host == null) {
			return new SnapshotClient(accessKey, secretKey);
		}
		return new SnapshotClient(host, accessKey, secretKey);
	}

	public VodClipClient buildVodClipClient() {
		if (host == null) {
			return new VodClipClient(accessKey, secretKey);
		}
		return new VodClipClient(host, accessKey, secretKey);
	}
}
